<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP                    #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE DefaultSignatures      #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE FlexibleInstances      #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE FunctionalDependencies #-}</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- | Per Conor McBride, the 'Newtype' typeclass represents the packing and</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- unpacking of a newtype, and allows you to operatate under that newtype with</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- functions such as 'ala'.</span><span>
</span><span id="line-8"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Distribution.Compat.Newtype</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-9"></span><span>    </span><span class="annot"><a href="Distribution.Compat.Newtype.html#Newtype"><span class="hs-identifier">Newtype</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-10"></span><span>    </span><span class="annot"><a href="Distribution.Compat.Newtype.html#ala"><span class="hs-identifier">ala</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-11"></span><span>    </span><span class="annot"><a href="Distribution.Compat.Newtype.html#alaf"><span class="hs-identifier">alaf</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-12"></span><span>    </span><span class="annot"><a href="Distribution.Compat.Newtype.html#pack%27"><span class="hs-identifier">pack'</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-13"></span><span>    </span><span class="annot"><a href="Distribution.Compat.Newtype.html#unpack%27"><span class="hs-identifier">unpack'</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-14"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-15"></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#"><span class="hs-identifier">Data.Functor.Identity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#Identity"><span class="hs-identifier">Identity</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Monoid.html#"><span class="hs-identifier">Data.Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Sum"><span class="hs-identifier">Sum</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Product"><span class="hs-identifier">Product</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier">Endo</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-cpp">

#if MIN_VERSION_base(4,7,0)
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Coerce.html#"><span class="hs-identifier">Data.Coerce</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">coerce</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier">Coercible</span></span><span class="hs-special">)</span><span class="hs-cpp">
#else
</span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Unsafe.Coerce</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">unsafeCoerce</span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-25"></span><span class="hs-comment">-- | The @FunctionalDependencies@ version of 'Newtype' type-class.</span><span>
</span><span id="line-26"></span><span class="hs-comment">--</span><span>
</span><span id="line-27"></span><span class="hs-comment">-- Since Cabal-3.0 class arguments are in a different order than in @newtype@ package.</span><span>
</span><span id="line-28"></span><span class="hs-comment">-- This change is to allow usage with @DeriveAnyClass@ (and @DerivingStrategies@, in GHC-8.2).</span><span>
</span><span id="line-29"></span><span class="hs-comment">-- Unfortunately one have to repeat inner type.</span><span>
</span><span id="line-30"></span><span class="hs-comment">--</span><span>
</span><span id="line-31"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-32"></span><span class="hs-comment">-- newtype New = New Old</span><span>
</span><span id="line-33"></span><span class="hs-comment">--   deriving anyclass (Newtype Old)</span><span>
</span><span id="line-34"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-35"></span><span class="hs-comment">--</span><span>
</span><span id="line-36"></span><span class="hs-comment">-- Another approach would be to use @TypeFamilies@ (and possibly</span><span>
</span><span id="line-37"></span><span class="hs-comment">-- compute inner type using &quot;GHC.Generics&quot;), but we think @FunctionalDependencies@</span><span>
</span><span id="line-38"></span><span class="hs-comment">-- version gives cleaner type signatures.</span><span>
</span><span id="line-39"></span><span class="hs-comment">--</span><span>
</span><span id="line-40"></span><span class="hs-keyword">class</span><span> </span><span id="Newtype"><span class="annot"><a href="Distribution.Compat.Newtype.html#Newtype"><span class="hs-identifier hs-var">Newtype</span></a></span></span><span> </span><span id="local-6989586621679612428"><span class="annot"><a href="#local-6989586621679612428"><span class="hs-identifier hs-type">o</span></a></span></span><span> </span><span id="local-6989586621679612427"><span class="annot"><a href="#local-6989586621679612427"><span class="hs-identifier hs-type">n</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="#local-6989586621679612427"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612428"><span class="hs-identifier hs-type">o</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-41"></span><span>    </span><span id="pack"><span class="annot"><a href="Distribution.Compat.Newtype.html#pack"><span class="hs-identifier hs-type">pack</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679612428"><span class="hs-identifier hs-type">o</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612427"><span class="hs-identifier hs-type">n</span></a></span><span class="hs-cpp">
#if MIN_VERSION_base(4,7,0)
</span><span>    </span><span class="hs-keyword">default</span><span> </span><span id="pack"><span class="annot"><a href="Distribution.Compat.Newtype.html#pack"><span class="hs-identifier hs-type">pack</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Coercible</span></span><span> </span><span class="annot"><a href="#local-6989586621679612428"><span class="hs-identifier hs-type">o</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612427"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612428"><span class="hs-identifier hs-type">o</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612427"><span class="hs-identifier hs-type">n</span></a></span><span>
</span><span id="line-44"></span><span>    </span><span id="local-6989586621679612359"><span class="annot"><a href="Distribution.Compat.Newtype.html#pack"><span class="hs-identifier hs-var hs-var">pack</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">o -&gt; n
</span><span class="hs-identifier hs-var">coerce</span></span></span><span class="hs-cpp">
#else
</span><span>    </span><span class="hs-keyword">default</span><span> </span><span class="hs-identifier">pack</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">o</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">n</span><span>
</span><span id="line-47"></span><span>    </span><span class="hs-identifier">pack</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">unsafeCoerce</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-50"></span><span>    </span><span id="unpack"><span class="annot"><a href="Distribution.Compat.Newtype.html#unpack"><span class="hs-identifier hs-type">unpack</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679612427"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612428"><span class="hs-identifier hs-type">o</span></a></span><span class="hs-cpp">
#if MIN_VERSION_base(4,7,0)
</span><span>    </span><span class="hs-keyword">default</span><span> </span><span id="unpack"><span class="annot"><a href="Distribution.Compat.Newtype.html#unpack"><span class="hs-identifier hs-type">unpack</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Coercible</span></span><span> </span><span class="annot"><a href="#local-6989586621679612427"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612428"><span class="hs-identifier hs-type">o</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612427"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612428"><span class="hs-identifier hs-type">o</span></a></span><span>
</span><span id="line-53"></span><span>    </span><span id="local-6989586621679612355"><span class="annot"><a href="Distribution.Compat.Newtype.html#unpack"><span class="hs-identifier hs-var hs-var">unpack</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">n -&gt; o
</span><span class="hs-identifier hs-var">coerce</span></span></span><span class="hs-cpp">
#else
</span><span>    </span><span class="hs-keyword">default</span><span> </span><span class="hs-identifier">unpack</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">n</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">o</span><span>
</span><span id="line-56"></span><span>    </span><span class="hs-identifier">unpack</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">unsafeCoerce</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-59"></span><span id="local-6989586621679612423"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679612349"><span id="local-6989586621679612351"><span class="annot"><a href="Distribution.Compat.Newtype.html#Newtype"><span class="hs-identifier hs-type">Newtype</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612423"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#Identity"><span class="hs-identifier hs-type">Identity</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612423"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-60"></span><span id="local-6989586621679612422"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679612344"><span id="local-6989586621679612346"><span class="annot"><a href="Distribution.Compat.Newtype.html#Newtype"><span class="hs-identifier hs-type">Newtype</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612422"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Sum"><span class="hs-identifier hs-type">Sum</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612422"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-61"></span><span id="local-6989586621679612421"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679612340"><span id="local-6989586621679612342"><span class="annot"><a href="Distribution.Compat.Newtype.html#Newtype"><span class="hs-identifier hs-type">Newtype</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612421"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Product"><span class="hs-identifier hs-type">Product</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612421"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-62"></span><span id="local-6989586621679612420"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679612336"><span id="local-6989586621679612338"><span class="annot"><a href="Distribution.Compat.Newtype.html#Newtype"><span class="hs-identifier hs-type">Newtype</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679612420"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612420"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-type">Endo</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612420"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-65"></span><span class="hs-comment">--</span><span>
</span><span id="line-66"></span><span class="hs-comment">-- &gt;&gt;&gt; ala Sum foldMap [1, 2, 3, 4 :: Int]</span><span>
</span><span id="line-67"></span><span class="hs-comment">-- 10</span><span>
</span><span id="line-68"></span><span class="hs-comment">--</span><span>
</span><span id="line-69"></span><span class="hs-comment">-- /Note:/ the user supplied function for the newtype is /ignored/.</span><span>
</span><span id="line-70"></span><span class="hs-comment">--</span><span>
</span><span id="line-71"></span><span class="hs-comment">-- &gt;&gt;&gt; ala (Sum . (+1)) foldMap [1, 2, 3, 4 :: Int]</span><span>
</span><span id="line-72"></span><span class="hs-comment">-- 10</span><span>
</span><span id="line-73"></span><span id="local-6989586621679612415"><span id="local-6989586621679612416"><span id="local-6989586621679612417"><span id="local-6989586621679612418"><span id="local-6989586621679612419"><span class="annot"><a href="Distribution.Compat.Newtype.html#ala"><span class="hs-identifier hs-type">ala</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Compat.Newtype.html#Newtype"><span class="hs-identifier hs-type">Newtype</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612419"><span class="hs-identifier hs-type">o</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612418"><span class="hs-identifier hs-type">n</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Compat.Newtype.html#Newtype"><span class="hs-identifier hs-type">Newtype</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612417"><span class="hs-identifier hs-type">o'</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612416"><span class="hs-identifier hs-type">n'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679612419"><span class="hs-identifier hs-type">o</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612418"><span class="hs-identifier hs-type">n</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679612419"><span class="hs-identifier hs-type">o</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612418"><span class="hs-identifier hs-type">n</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612415"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612416"><span class="hs-identifier hs-type">n'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679612415"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612417"><span class="hs-identifier hs-type">o'</span></a></span><span class="hs-special">)</span></span></span></span></span></span><span>
</span><span id="line-74"></span><span id="ala"><span class="annot"><span class="annottext">ala :: forall o n o' n' b.
(Newtype o n, Newtype o' n') =&gt;
(o -&gt; n) -&gt; ((o -&gt; n) -&gt; b -&gt; n') -&gt; b -&gt; o'
</span><a href="Distribution.Compat.Newtype.html#ala"><span class="hs-identifier hs-var hs-var">ala</span></a></span></span><span> </span><span id="local-6989586621679612331"><span class="annot"><span class="annottext">o -&gt; n
</span><a href="#local-6989586621679612331"><span class="hs-identifier hs-var">pa</span></a></span></span><span> </span><span id="local-6989586621679612330"><span class="annot"><span class="annottext">(o -&gt; n) -&gt; b -&gt; n'
</span><a href="#local-6989586621679612330"><span class="hs-identifier hs-var">hof</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(o -&gt; n) -&gt; ((o -&gt; n) -&gt; b -&gt; n') -&gt; (o -&gt; o) -&gt; b -&gt; o'
forall o n o' n' a b.
(Newtype o n, Newtype o' n') =&gt;
(o -&gt; n) -&gt; ((a -&gt; n) -&gt; b -&gt; n') -&gt; (a -&gt; o) -&gt; b -&gt; o'
</span><a href="Distribution.Compat.Newtype.html#alaf"><span class="hs-identifier hs-var">alaf</span></a></span><span> </span><span class="annot"><span class="annottext">o -&gt; n
</span><a href="#local-6989586621679612331"><span class="hs-identifier hs-var">pa</span></a></span><span> </span><span class="annot"><span class="annottext">(o -&gt; n) -&gt; b -&gt; n'
</span><a href="#local-6989586621679612330"><span class="hs-identifier hs-var">hof</span></a></span><span> </span><span class="annot"><span class="annottext">o -&gt; o
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-75"></span><span>
</span><span id="line-76"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-77"></span><span class="hs-comment">--</span><span>
</span><span id="line-78"></span><span class="hs-comment">-- &gt;&gt;&gt; alaf Sum foldMap length [&quot;cabal&quot;, &quot;install&quot;]</span><span>
</span><span id="line-79"></span><span class="hs-comment">-- 12</span><span>
</span><span id="line-80"></span><span class="hs-comment">--</span><span>
</span><span id="line-81"></span><span class="hs-comment">-- /Note:/ as with 'ala', the user supplied function for the newtype is /ignored/.</span><span>
</span><span id="line-82"></span><span id="local-6989586621679612404"><span id="local-6989586621679612405"><span id="local-6989586621679612406"><span id="local-6989586621679612407"><span id="local-6989586621679612408"><span id="local-6989586621679612409"><span class="annot"><a href="Distribution.Compat.Newtype.html#alaf"><span class="hs-identifier hs-type">alaf</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Compat.Newtype.html#Newtype"><span class="hs-identifier hs-type">Newtype</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612409"><span class="hs-identifier hs-type">o</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612408"><span class="hs-identifier hs-type">n</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Compat.Newtype.html#Newtype"><span class="hs-identifier hs-type">Newtype</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612407"><span class="hs-identifier hs-type">o'</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612406"><span class="hs-identifier hs-type">n'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679612409"><span class="hs-identifier hs-type">o</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612408"><span class="hs-identifier hs-type">n</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679612405"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612408"><span class="hs-identifier hs-type">n</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612404"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612406"><span class="hs-identifier hs-type">n'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679612405"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612409"><span class="hs-identifier hs-type">o</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679612404"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612407"><span class="hs-identifier hs-type">o'</span></a></span><span class="hs-special">)</span></span></span></span></span></span></span><span>
</span><span id="line-83"></span><span id="alaf"><span class="annot"><span class="annottext">alaf :: forall o n o' n' a b.
(Newtype o n, Newtype o' n') =&gt;
(o -&gt; n) -&gt; ((a -&gt; n) -&gt; b -&gt; n') -&gt; (a -&gt; o) -&gt; b -&gt; o'
</span><a href="Distribution.Compat.Newtype.html#alaf"><span class="hs-identifier hs-var hs-var">alaf</span></a></span></span><span> </span><span class="annot"><span class="annottext">o -&gt; n
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679612324"><span class="annot"><span class="annottext">(a -&gt; n) -&gt; b -&gt; n'
</span><a href="#local-6989586621679612324"><span class="hs-identifier hs-var">hof</span></a></span></span><span> </span><span id="local-6989586621679612323"><span class="annot"><span class="annottext">a -&gt; o
</span><a href="#local-6989586621679612323"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">n' -&gt; o'
forall o n. Newtype o n =&gt; n -&gt; o
</span><a href="Distribution.Compat.Newtype.html#unpack"><span class="hs-identifier hs-var">unpack</span></a></span><span> </span><span class="annot"><span class="annottext">(n' -&gt; o') -&gt; (b -&gt; n') -&gt; b -&gt; o'
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; n) -&gt; b -&gt; n'
</span><a href="#local-6989586621679612324"><span class="hs-identifier hs-var">hof</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">o -&gt; n
forall o n. Newtype o n =&gt; o -&gt; n
</span><a href="Distribution.Compat.Newtype.html#pack"><span class="hs-identifier hs-var">pack</span></a></span><span> </span><span class="annot"><span class="annottext">(o -&gt; n) -&gt; (a -&gt; o) -&gt; a -&gt; n
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; o
</span><a href="#local-6989586621679612323"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-84"></span><span>
</span><span id="line-85"></span><span class="hs-comment">-- | Variant of 'pack', which takes a phantom type.</span><span>
</span><span id="line-86"></span><span id="local-6989586621679612392"><span id="local-6989586621679612393"><span class="annot"><a href="Distribution.Compat.Newtype.html#pack%27"><span class="hs-identifier hs-type">pack'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Compat.Newtype.html#Newtype"><span class="hs-identifier hs-type">Newtype</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612393"><span class="hs-identifier hs-type">o</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612392"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679612393"><span class="hs-identifier hs-type">o</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612392"><span class="hs-identifier hs-type">n</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612393"><span class="hs-identifier hs-type">o</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612392"><span class="hs-identifier hs-type">n</span></a></span></span></span><span>
</span><span id="line-87"></span><span id="pack%27"><span class="annot"><span class="annottext">pack' :: forall o n. Newtype o n =&gt; (o -&gt; n) -&gt; o -&gt; n
</span><a href="Distribution.Compat.Newtype.html#pack%27"><span class="hs-identifier hs-var hs-var">pack'</span></a></span></span><span> </span><span class="annot"><span class="annottext">o -&gt; n
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">o -&gt; n
forall o n. Newtype o n =&gt; o -&gt; n
</span><a href="Distribution.Compat.Newtype.html#pack"><span class="hs-identifier hs-var">pack</span></a></span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span class="hs-comment">-- | Variant of 'pack', which takes a phantom type.</span><span>
</span><span id="line-90"></span><span id="local-6989586621679612388"><span id="local-6989586621679612389"><span class="annot"><a href="Distribution.Compat.Newtype.html#unpack%27"><span class="hs-identifier hs-type">unpack'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Compat.Newtype.html#Newtype"><span class="hs-identifier hs-type">Newtype</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612389"><span class="hs-identifier hs-type">o</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679612388"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679612389"><span class="hs-identifier hs-type">o</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612388"><span class="hs-identifier hs-type">n</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612388"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679612389"><span class="hs-identifier hs-type">o</span></a></span></span></span><span>
</span><span id="line-91"></span><span id="unpack%27"><span class="annot"><span class="annottext">unpack' :: forall o n. Newtype o n =&gt; (o -&gt; n) -&gt; n -&gt; o
</span><a href="Distribution.Compat.Newtype.html#unpack%27"><span class="hs-identifier hs-var hs-var">unpack'</span></a></span></span><span> </span><span class="annot"><span class="annottext">o -&gt; n
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">n -&gt; o
forall o n. Newtype o n =&gt; n -&gt; o
</span><a href="Distribution.Compat.Newtype.html#unpack"><span class="hs-identifier hs-var">unpack</span></a></span><span>
</span><span id="line-92"></span></pre></body></html>